/* 
 * File:   ZipWriter.h
 * Author: jorge
 *
 * Created on July 1, 2013, 6:37 PM
 */

#ifndef ZIPWRITER_H
#define	ZIPWRITER_H

#include "CentralDirectory.h"
#include "EndOfCentralDirectory.h"
#include <vector>
#include <iostream>
#include <fstream>

class FileHeader;

class ZipWriter
{
public:

    ~ZipWriter();
    void write(std::vector<FileHeader*> fileHeaderList, EndOfCentralDirectory* endOfCentralDirectory, const char* destinyPath, const char* fileName);
private:
    void writeFileHeaders(std::vector<FileHeader*> fileHeaderList);
    void writeCentralDirectories(std::vector<FileHeader*> fileHeaderList);
    
    std::ofstream output_;
    int offsetCentralDirectory;
    int centralDirectoriesSize;
};
#endif	/* ZIPWRITER_H */

